package com.example.demo.system.utility;

import lombok.Data;

import java.util.List;

/**
 * 列表结果返回类
 */
@Data
public class PageInfo {

    //页数
    private Integer pageNum;
    //每页条数
    private Integer pageSize;
    //总条数
    private Integer totalCount;
    //集合数据
    private List rows;

    public PageInfo(Integer pageNum,Integer pageSize,Integer totalCount,List rows){
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        this.rows = rows;
    }

    public static Integer start(Integer pageNum, Integer pageSize){
        Integer start = (pageNum - 1) * pageSize;
        return start;
    }

}
